﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UPNP.Inspector
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

        private void updateLogBoxTimer_Tick(object sender, EventArgs e)
        {
            var la = LogBoxAppender.Instance;

            if (la == null)
                return;

            // anything to do?
            if (la.Messages.Count <= 0)
                return;

            // gather entries
            this.logBox.SuspendLayout();

            while (la.Messages.Count > 0)
            {
                var msg = la.Messages.Dequeue();

                this.logBox.Items.Add(msg);
            }

            this.logBox.TopIndex = this.logBox.Items.Count - 1;

            this.logBox.ResumeLayout();
        }

	}
}
